package com.fujitsu.nanjing.tieba.dao;

import com.fujitsu.nanjing.tieba.ibator.CoreCensorLog;
import com.fujitsu.nanjing.tieba.ibator.CoreCensorLogCriteria;
import java.util.List;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class CoreCensorLogDAOImpl extends SqlMapClientDaoSupport implements CoreCensorLogDAO {

    public CoreCensorLogDAOImpl() {
        super();
    }

    public int countByExample(CoreCensorLogCriteria example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("core_censor_log.countByExample", example);
        return count;
    }

    public int deleteByExample(CoreCensorLogCriteria example) {
        int rows = getSqlMapClientTemplate().delete("core_censor_log.deleteByExample", example);
        return rows;
    }

    public int deleteByPrimaryKey(Integer logid) {
        CoreCensorLog _key = new CoreCensorLog();
        _key.setLogid(logid);
        int rows = getSqlMapClientTemplate().delete("core_censor_log.deleteByPrimaryKey", _key);
        return rows;
    }

    public void insert(CoreCensorLog record) {
        getSqlMapClientTemplate().insert("core_censor_log.insert", record);
    }

    public void insertSelective(CoreCensorLog record) {
        getSqlMapClientTemplate().insert("core_censor_log.insertSelective", record);
    }

    @SuppressWarnings("unchecked")
    public List<CoreCensorLog> selectByExample(CoreCensorLogCriteria example) {
        List<CoreCensorLog> list = getSqlMapClientTemplate().queryForList("core_censor_log.selectByExample", example);
        return list;
    }

    public CoreCensorLog selectByPrimaryKey(Integer logid) {
        CoreCensorLog _key = new CoreCensorLog();
        _key.setLogid(logid);
        CoreCensorLog record = (CoreCensorLog) getSqlMapClientTemplate().queryForObject("core_censor_log.selectByPrimaryKey", _key);
        return record;
    }

    public int updateByExampleSelective(CoreCensorLog record, CoreCensorLogCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_censor_log.updateByExampleSelective", parms);
        return rows;
    }

    public int updateByExample(CoreCensorLog record, CoreCensorLogCriteria example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("core_censor_log.updateByExample", parms);
        return rows;
    }

    public int updateByPrimaryKeySelective(CoreCensorLog record) {
        int rows = getSqlMapClientTemplate().update("core_censor_log.updateByPrimaryKeySelective", record);
        return rows;
    }

    public int updateByPrimaryKey(CoreCensorLog record) {
        int rows = getSqlMapClientTemplate().update("core_censor_log.updateByPrimaryKey", record);
        return rows;
    }

    protected static class UpdateByExampleParms extends CoreCensorLogCriteria {
        private Object record;

        public UpdateByExampleParms(Object record, CoreCensorLogCriteria example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}